<!--#include virtual="/common/Config.asp" -->
<!--#include virtual="/common/conn.asp" -->
<!--#include virtual="/common/function.asp" -->
<%
'Dim FM_ID	
'Dim Big_ID
'Dim Corp_City_Area
'Dim City_ID
'Dim Corp_Name
'Dim Corp_Pic
'Dim Corp_Detail		
'Dim Corp_Tel		
'Dim Corp_Fax		
'Dim Corp_Address
'Dim Corp_Address_S
'Dim Corp_Open		
'Dim Corp_Business	
'Dim Corp_SI
'Dim Corp_Username
'Sub Get_Corp_Info()
'
'	fm_id = Requery("fm_id")
'
'	Call Check_IsNumeric(fm_id)
'
'	Sql = "SELECT * FROM Corp_Info WHERE ID="&fm_id
'
'
'	Set rs = conn.execute(sql)
'	
'	If Not rs.eof Then
'		Corp_City_Area	= rs("Corp_City_Area") 
'		Corp_Type       = rs("Corp_Type")
'		Corp_Name		= rs("Corp_Name")
'		Corp_Pic		= rs("Corp_Pic")
'		Corp_Detail		= rs("Corp_Detail")
'		Corp_Tel		= rs("Corp_Tel")
'		Corp_Fax		= rs("Corp_Fax")
'		Corp_Address	= rs("Corp_Address")
'		Corp_Address_S	= rs("Corp_Address_S")
'		Corp_Open		= rs("Corp_Open")
'		Corp_Business	= rs("Corp_Business")
'		Corp_SI			= rs("Corp_SI")
'		Corp_Username	= rs("Corp_Username")					   
'		Update_Name    = rs("Update_Name")
'		Update_Date    = rs("Update_Date")
'
'	End If
'
'End Sub 
Sub Save_Comment()
	If Comment_Add() = True Then  
		alertBox "点评成功!","detail.asp?HR_ID="&reform("HR_ID")
	Else
		alertBox "请输入正确的信息!","javascript:history.go(-1)"
	End If

End Sub 
Function Comment_Add()
	comment_content = encode_html(reform("comment_content"))
	HR_ID = reform("HR_ID")
	comment_item  = reform("comment_item1")
	comment_item1 = reform("comment_item2")

	If session("username")="" Then 
		username = "游客"
	Else
		username = 	session("username")
	End If 

	sql = "INSERT INTO Member_Person_Comment( " &_
			" HR_ID"&_			
			",UserName"&_		
			",Comment"&_			

			",Comment_Item"&_	
			",Comment_Item1"&_	

			",Update_Date"&_		
			") VALUES( " &_


			" "&HR_ID&_			
			",'"&UserName&"'"&_		
			",'"&comment_content&"'"&_			

			",'"&Comment_Item&"'"&_	
			",'"&Comment_Item1&"'"&_	

			",'"&Now()&"'"&_	
			")"
		'On Error Resume Next
		conn.execute(sql)

		If Err.Number<>0  Then
			Comment_Add=False
		Else
			Err.Clear
			Comment_Add = True
		End If 

End Function 
Sub Get_Comments_Icon(Comment_Item)
	For xx=1 To Comment_Item
		Response.Write "<img src=""images/IMG/k_y.gif"" />"
	Next
	For xx=1 To 5-Comment_Item
		Response.Write "<img src=""images/IMG/k_w.gif"" />"
	Next
End Sub 
Sub Recomment_Corp_List()
	Sql = "SELECT  TOP 10 b.ID,b.Corp_Name,b.Corp_Pic FROM uvw_Sort_Info a INNER JOIN Corp_Info b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='推荐企业' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		Response.Write "<ul class=""commend_f_pic"">"
		For i=0 To UBound(Info_List,2)
			ID		   = Info_List(0,i)
			Corp_Name  = Info_List(1,i)
			Corp_Pic   = Info_List(2,i)
			If Corp_Pic="" Or IsNull(Corp_Pic) Then 
				Corp_Pic = "/images/none.png"
			End If 
			detail_url		= "/family/family_detail.asp?fm_id="&ID
			Response.Write "<li><a href="""&detail_url&"""><img src="""&Corp_Pic&"""  width=116 height=64 /></a><p><a href="""&detail_url&""">"&Corp_Name&"</a></p></li>"
			If i=1 Then Exit For 
		Next 
		Response.Write "</ul>"
		Response.Write "<p class=""v4_line mar_n_line"" style=""margin:2px 8px;""></p>"
		Response.Write "<ul class=""commend_f_txt"">"
		For i=2 To UBound(Info_List,2)
			ID		   = Info_List(0,i)
			Corp_Name  = Info_List(1,i)
			Corp_Pic   = Info_List(2,i)
			If Corp_Pic="" Or IsNull(Corp_Pic) Then 
				Corp_Pic = "/images/none.png"
			End If 
			detail_url		= "/family/family_detail.asp?fm_id="&ID

			Response.Write "<li><a href="""&detail_url&""">"&Corp_Name&"</a></li>"
		Next 
		Response.Write "</ul>"
	End If 

End Sub 

'Sub Corp_Sale_News_List()
'	Sql = "SELECT  TOP 20 b.ID,b.News_Title,b.UserName FROM uvw_Sort_Info a INNER JOIN Corp_Sale_News b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='频道优惠信息' ORDER  BY a.Sort_Order ASC"
'	Info_List = GetRsRows(Sql)
'	If IsArray(Info_List) Then 
'		For i=0 To UBound(Info_List,2)
'			News_Title = Info_List(1,i)
'			UserName   = Info_List(2,i)	
'			fm_id = get_firstvalue("SELECT ID FROM Corp_Info WHERE Corp_Username='"&UserName&"'")
'			detail_url		= "family_detail.asp?fm_id="&fm_id&"#N-D"
'			Response.Write "<li><a href="""&detail_url&""">·"&News_Title&"</a></li>"
'		Next 
'	
'	End If 
'
'End Sub
Sub HR_Recommend_List()
	Sql = "SELECT  TOP 9 b.ID,b.Photo,b.TrueName FROM uvw_Sort_Info a INNER JOIN Corp_Person_Info b ON a.Info_ID = b.ID  WHERE  a.Sort_Sub_Name='推荐家政人才' ORDER  BY a.Sort_Order ASC"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			ID		   = Info_List(0,i)
			Photo	   = Info_List(1,i)
			TrueName   = Info_List(2,i)		
			detail_url		= "detail.asp?HR_ID="&ID
			Response.Write "<li><a href="""&detail_url&"""><img src="""&Photo&""" width=66 height=74/></a><p><a href="""&detail_url&""">"&TrueName&"</a></p></li>"
		Next 
	
	End If 

End Sub

Dim HR_ID				
Dim UserName		
Dim Photo			
Dim Truename		
Dim Sex				
Dim Birthday		
Dim Nation			
Dim Location		
Dim Married			
Dim Health_Car		

Dim Service_Item    
Dim Service_Status	
Dim Service_Corp	
Dim Work_Year		
Dim Tel				
Dim Education		
Dim Special	
Dim Corp_Name
Sub Get_Hr_Info()
	HR_ID = Requery("HR_ID")

	Call Check_IsNumeric(HR_ID)

	Sql = "SELECT Corp_Person_Info.*,Corp_Info.Corp_Name FROM Corp_Person_Info INNER JOIN Corp_Info ON Corp_Person_Info.Corp_Username=Corp_Info.Corp_Username WHERE  Corp_Person_Info.ID="&HR_ID

	Set rs = conn.execute(sql)
	
	If Not rs.eof Then
		Photo = rs("Photo")			
		Truename = rs("Truename")		
		Sex = rs("Sex")				
		Birthday = rs("Birthday")		
		Nation = rs("Nation")			
		Location = rs("Location")		
		Married = rs("Married")			
		Health_Car = rs("Health_Car")		

		Service_Item = rs("Service_Item")    
		Service_Status = rs("Service_Status")	
		Service_Corp = rs("Service_Corp")	
		Work_Year = rs("Work_Year")		
		Tel = rs("Tel")				
		Education = rs("Education")		
		Special = rs("Special")	
		Service_Item = Get_Service_Item(HR_ID)
		Corp_Name = rs("Corp_Name")
	End If

End Sub 
Function  Get_Service_Item(Corp_Person_ID)
	Service_Item_S = ""
	Sql = "SELECT dsi_name FROM uvw_dic_item a INNER JOIN Corp_Person_Service_Item  b ON a.dsi_id=b.Service_Item_ID WHERE b.Corp_Person_ID="&Corp_Person_ID
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			dsi_name   = Info_List(0,i)
			Service_Item_S = Service_Item_S&","&dsi_name
		Next 
	
	End If 
	If Service_Item_S<>"" Then 
		Service_Item_S = Mid(Service_Item_S,2,Len(Service_Item_S))
	End If 
	Get_Service_Item = Service_Item_S
End Function 
Sub Get_Last_Corp_List()
	Sql = "SELECT top 20  username,max(id) as max_id FROM Member_Corp_Offers GROUP BY username ORDER BY max_id desc"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			corp_username   = Info_List(0,i)
			Memebr_Corp = Get_FirstValue("SELECT Corp_Name FROM Corp_Info WHERE Corp_Username='"&corp_username&"'")
			detail_url		= "Recruit_Detail.asp?Corp_Name="&urlencode(corp_username)
			Response.Write "<li>"
			Response.Write "<span class=""company""><a href="""&detail_url&""">"&Memebr_Corp&"</a>"
			Response.Write "</span>"
			Response.Write "<span class=""position"">"
			Sql = "SELECT TOP 3 ID,Post FROM Member_Corp_Offers WHERE UserName='"&corp_username&"'"
			Info_List2 = GetRsRows(Sql)
			If IsArray(Info_List2) Then 
				For ii=0 To UBound(Info_List2,2)
					Offers_ID = Info_List2(0,ii)
					Post	  = Info_List2(1,ii)
					detail_url2		= "Job_Detail.asp?Job_ID="&Offers_ID
					Response.Write "<a href="""&detail_url2&""">"&Post&"</a> "
				Next 
			End If 
			Response.Write "</span>"
			Response.Write "</li>"

		Next 
	
	End If 

End Sub 
Sub  Get_Order_Service_Item()
	Sql = "SELECT dsi_name FROM uvw_dic_item a INNER JOIN Member_Person_Service_Item  b ON a.dsi_id=b.Service_Item_ID WHERE b.username='"&UserName&"'"
	Info_List = GetRsRows(Sql)
	If IsArray(Info_List) Then 
		For i=0 To UBound(Info_List,2)
			dsi_name   = Info_List(0,i)
			Response.Write "<input name=""order_service_item"" type=""checkbox"" value="""&dsi_name&""" />"&dsi_name
		Next 
	
	End If 
End Sub 
Function  HR_Order_Add()

	Order_Type				= "家政雇工"

	order_name = Reform("order_name")
	order_tel = Reform("order_tel")
	order_service_to = Reform("order_service_to")
	order_pay = Reform("order_pay")
	order_date = Reform("order_date")
	order_home = Reform("order_home")
	order_address = Reform("order_address")
	order_service_item = Reform("order_service_item")
	order_remark = Reform("order_remark")
	Corp_Name	 = Reform("Corp_Name")
	TrueName	 = Reform("TrueName")
	cr=Chr(13) & Chr(10)
	
	Order_Price  = 0
	
	Order_Content=  "公司名称："&Corp_Name&cr&_
					"工作人员姓名："&TrueName&cr&_
					"雇主姓名："&order_name&cr&_
					"联系电话："&order_tel&cr&_
					"服务对象："&order_service_to&cr&_
					"计划薪酬："&order_pay&cr&_
					"用工时间："&order_date&cr&_
					"是否住家："&order_home&cr&_
					"家庭地址："&order_address&cr&_
					"所需服务："&order_service_item&cr&_
					"备　　注："&order_remark&cr
					




	If Session("UserName")="" Or IsNull(Session("UserName")) Or IsEmpty(Session("UserName")) Then '未登录时使用联系人姓名
		Order_UserName = order_name 
	Else
		Order_UserName = Session("UserName")
	End If 
	Order_Email  = ""
	Order_No = Order_Add(Order_Type,Order_Content,Order_Price,Order_UserName,order_name,order_tel,order_tel,Order_Email,order_remark)

	HR_Order_Add = Order_No
End Function 
%>